package edu.hubu.store.dao;

import edu.hubu.store.domain.User;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
@Repository
@Mapper
public interface UserDao {
	/**
	 * 添加用户
	 * @param user
	 */
	public void addUser(User user);

	/**
	 * 根据激活码查找用户
	 * @param activeCode
	 * @return
	 */
	public User findUserByActiveCode(String activeCode);

	// 激活用戶
	public void activeUser(String activeCode);

	/**
	 * 根据用户名与密码查找用户
	 * @param username
	 * @param password
	 * @return
	 */
	public User findUserByUsernameAndPassword(String username, String password);

}
